package main

import "fmt"

func main() {
	s := []int{1, 2}

	swap(s)
	fmt.Println("s =", s) // s = [1 2]
}

func swap(s []int) {
	s = append(s, 1) // 不生效，扩容了
	s[0], s[1] = s[1], s[0]
}
